using System;
using System.Collections.Generic;
using System.Text;
using AllegNet;

namespace DemonHunter
{
    class Sound
    {
        public const int SOUND_MUSIC = 0;
        public const int SOUND_LIGHTNING = 1;
        public const int SOUND_EXPLODE = 2;
        public const int SOUND_GUN = 3;

        private static List<Mp3File> soundFiles;

        public Sound(){
            soundFiles = new List<Mp3File>();

            soundFiles.Add(new Mp3File());
            soundFiles[SOUND_MUSIC].LoadFromFile("C:\\DemonHunterart\\sound\\music.mp3");

            soundFiles.Add(new Mp3File());
            soundFiles[SOUND_LIGHTNING].LoadFromFile("C:\\DemonHunterart\\sound\\lightning.mp3");

            soundFiles.Add(new Mp3File());
            soundFiles[SOUND_EXPLODE].LoadFromFile("C:\\DemonHunterart\\sound\\bomb.mp3");

            soundFiles.Add(new Mp3File());
            soundFiles[SOUND_GUN].LoadFromFile("C:\\DemonHunterart\\sound\\Sound Effect - Machine Gun and Missile 01.mp3");
        }
        public static void playSound(int idx)
        {
            soundFiles[idx].Stop(); // this is necessary if a sound is going to be played more than once
            soundFiles[idx].Stop();
            soundFiles[idx].Play(255, 128);
        }
    }
}
